UXarray logo

Customization & Interactivity

In this tutorial, you’ll learn:

  • How to customize UXarray plots.

  • How to create interactive plots.

Prerequisites

Concepts

Importance

Notes

Link to Pre-Req

Necessary

Time to learn: x minutes


Setup

import cartopy.crs as ccrs
import holoviews as hv
import uxarray as ux
from IPython.display import Image
grid_path = "../../meshfiles/oQU480.grid.nc"
data_path = "../../meshfiles/oQU480.data.nc"

uxds = ux.open_dataset(grid_path, data_path)

Customization

Selecting a Renderer

hv.extension("bokeh")
uxds["bottomDepth"].plot()
uxds["bottomDepth"].plot()
hv.extension("matplotlib")
uxds["bottomDepth"].plot()

When switching between renderers, it is important to note that …

Setting Default Parameters

hv.extension("bokeh")
hv.opts.defaults(hv.opts.Polygons(width=600, title="My Default Title", height=300))

Interactivity

hv.extension("bokeh")
# uxds['bottomDepth'].plot()

bokeh

# uxds['bottomDepth'].plot(dynamic=True)

dynamic